/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "BoilHopNotes")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BoilHopNotes.findAll", query = "SELECT b FROM BoilHopNotes b"),
    @NamedQuery(name = "BoilHopNotes.findByBoilHopNoteID", query = "SELECT b FROM BoilHopNotes b WHERE b.boilHopNoteID = :boilHopNoteID"),
    @NamedQuery(name = "BoilHopNotes.findByBoilHopTime", query = "SELECT b FROM BoilHopNotes b WHERE b.boilHopTime = :boilHopTime"),
    @NamedQuery(name = "BoilHopNotes.findByBoilHopLbs", query = "SELECT b FROM BoilHopNotes b WHERE b.boilHopLbs = :boilHopLbs")})
public class BoilHopNotes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "boilHopNoteID")
    private Integer boilHopNoteID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "boilHopTime")
    @Temporal(TemporalType.TIME)
    private Date boilHopTime;
    @Basic(optional = false)
    @NotNull
    @Column(name = "boilHopLbs")
    private float boilHopLbs;
    @JoinColumn(name = "boilHopID", referencedColumnName = "HID", nullable=true)
    @ManyToOne(optional = true)
    private Hops hopID;

    public BoilHopNotes() {
    }

    public BoilHopNotes(Integer boilHopNoteID) {
        this.boilHopNoteID = boilHopNoteID;
    }

    public BoilHopNotes(Integer boilHopNoteID, Date boilHopTime, float boilHopLbs) {
        this.boilHopNoteID = boilHopNoteID;
        this.boilHopTime = boilHopTime;
        this.boilHopLbs = boilHopLbs;
    }

    public Integer getBoilHopNoteID() {
        return boilHopNoteID;
    }

    public void setBoilHopNoteID(Integer boilHopNoteID) {
        this.boilHopNoteID = boilHopNoteID;
    }

    public Date getBoilHopTime() {
        return boilHopTime;
    }

    public void setBoilHopTime(Date boilHopTime) {
        this.boilHopTime = boilHopTime;
    }

    public float getBoilHopLbs() {
        return boilHopLbs;
    }

    public void setBoilHopLbs(float boilHopLbs) {
        this.boilHopLbs = boilHopLbs;
    }

    public Hops getHopID() {
        return hopID;
    }

    public void setHopID(Hops hopID) {
        this.hopID = hopID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (boilHopNoteID != null ? boilHopNoteID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BoilHopNotes)) {
            return false;
        }
        BoilHopNotes other = (BoilHopNotes) object;
        if ((this.boilHopNoteID == null && other.boilHopNoteID != null) || (this.boilHopNoteID != null && !this.boilHopNoteID.equals(other.boilHopNoteID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.BoilHopNotes[ boilHopNoteID=" + boilHopNoteID + " ]";
    }
    
}
